﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmFamilyService.h"
#include "IFamilyForm.h"

namespace gcmp
{
    class IParameter;
}

namespace gfam
{
    class IFamilyParameterDefinition;

    /// \brief 快速形体
    class GM_FAMILY_SERVICE_EXPORT IFamilyRapidForm : public IFamilyForm
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyRapidForm, gfam::IFamilyForm)

    public:

        static IFamilyRapidForm* Create(gcmp::IDocument* pDoc, const std::vector<gcmp::ElementId>& childObjectIds, const std::vector<gcmp::ElementId>& parameterDefinitionIds);

        /// \brief 获取管理的所有子对象id
        ///
        /// \return 子对象id集合
        virtual const std::vector<gcmp::ElementId>& GetChildObjectIds() const = 0;

        /// \brief 获取所有族参数定义id
        ///
        /// \return 族参数定义id集合
        virtual const std::vector<gcmp::ElementId>& GetFamilyParameterDefinitionIds() const = 0;

        /// \brief 根据ElementId获取族参数定义
        ///
        /// \param paramDefinitionId 族参数定义id
        /// \return 族参数定义指针
        virtual const IFamilyParameterDefinition* GetFamilyParameterDefinition(const gcmp::ElementId& familyParamDefinitionId) const = 0;

        /// \brief 根据uid获取族参数定义
        ///
        /// \param uid 族参数定义uid
        /// \return 族参数定义指针
        virtual const IFamilyParameterDefinition* GetFamilyParameterDefinition(const gcmp::UniIdentity& uid) const = 0;

        /// \brief 根据族参数定义获取参数
        ///
        /// \param familyParameterDefinition 族参数定义
        /// \return 参数指针
        virtual const gcmp::IParameter* GetParameter(const IFamilyParameterDefinition* familyParameterDefinition) const = 0;

        /// \brief 设置子对象可见性
        ///
        /// \param visible 可见性
        virtual void SetChildrenVisible(bool visible) = 0;

        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static gcmp::UniIdentity GetImplementationUid();

        /// \brief 获取快速形体锚点世界坐标
        ///
        /// \return 返回快速形体锚点世界坐标
        virtual gcmp::Vector3d GetAnchorPosition()const = 0;

        /// \brief 获取定位线轴Id
        ///
        /// \return Int32 返回定位线轴Id
        virtual Int32 GetAnchorAxisId() const = 0;
    };

}
